package cn.itcast.bos.before.quarz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import cn.itcast.bos.before.service.impl.PromotionServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
/*
 * 这个job的任务是在固定时间自动加载promotion模板
 */



public class LoadPromotionJob implements Job{
	
	@Autowired
	private PromotionServiceImpl promotionService;
	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		// TODO Auto-generated method stub
		try {
			promotionService.writeDataToHtml();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
